<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NVTX C++ API Reference: nvtx3::v1::named_category_in&lt; D &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">NVTX C++ API Reference<span id="projectnumber">&#160;1.0</span>
   </div>
   <div id="projectbrief">C++ convenience wrappers for NVTX v3 C API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>nvtx3</b></li><li class="navelem"><b>v1</b></li><li class="navelem"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classnvtx3_1_1v1_1_1named__category__in-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">nvtx3::v1::named_category_in&lt; D &gt; Class Template Reference<span class="mlabels"><span class="mlabel">final</span></span></div></div>
</div><!--header-->
<div class="contents">

<p>A <code>category</code> with an associated name string.  
 <a href="classnvtx3_1_1v1_1_1named__category__in.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for nvtx3::v1::named_category_in&lt; D &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classnvtx3_1_1v1_1_1named__category__in__inherit__graph.png" border="0" usemap="#anvtx3_1_1v1_1_1named__category__in_3_01_d_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="anvtx3_1_1v1_1_1named__category__in_3_01_d_01_4_inherit__map" id="anvtx3_1_1v1_1_1named__category__in_3_01_d_01_4_inherit__map">
<area shape="rect" title="A category with an associated name string." alt="" coords="5,79,205,119"/>
<area shape="rect" href="classnvtx3_1_1v1_1_1category.html" title="Object for intra&#45;domain grouping of NVTX events." alt="" coords="31,5,179,31"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for nvtx3::v1::named_category_in&lt; D &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classnvtx3_1_1v1_1_1named__category__in__coll__graph.png" border="0" usemap="#anvtx3_1_1v1_1_1named__category__in_3_01_d_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="anvtx3_1_1v1_1_1named__category__in_3_01_d_01_4_coll__map" id="anvtx3_1_1v1_1_1named__category__in_3_01_d_01_4_coll__map">
<area shape="rect" title="A category with an associated name string." alt="" coords="5,79,205,119"/>
<area shape="rect" href="classnvtx3_1_1v1_1_1category.html" title="Object for intra&#45;domain grouping of NVTX events." alt="" coords="31,5,179,31"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7fe4261f6a0b9d1cfb6e566d8ff2135f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a7fe4261f6a0b9d1cfb6e566d8ff2135f">named_category_in</a> (<a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a> id, char const *name) noexcept</td></tr>
<tr class="memdesc:a7fe4261f6a0b9d1cfb6e566d8ff2135f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> with the specified <code>id</code> and <code>name</code>.  <a href="classnvtx3_1_1v1_1_1named__category__in.html#a7fe4261f6a0b9d1cfb6e566d8ff2135f">More...</a><br /></td></tr>
<tr class="separator:a7fe4261f6a0b9d1cfb6e566d8ff2135f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b8ac1f00f1c0686858a20884c8eb19a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a0b8ac1f00f1c0686858a20884c8eb19a">named_category_in</a> (<a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a> id, wchar_t const *name) noexcept</td></tr>
<tr class="memdesc:a0b8ac1f00f1c0686858a20884c8eb19a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> with the specified <code>id</code> and <code>name</code>.  <a href="classnvtx3_1_1v1_1_1named__category__in.html#a0b8ac1f00f1c0686858a20884c8eb19a">More...</a><br /></td></tr>
<tr class="separator:a0b8ac1f00f1c0686858a20884c8eb19a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classnvtx3_1_1v1_1_1category"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classnvtx3_1_1v1_1_1category')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classnvtx3_1_1v1_1_1category.html">nvtx3::v1::category</a></td></tr>
<tr class="memitem:a16b26c66ef40850b7bf79fb8e8b9ccec inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top">constexpr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1category.html#a16b26c66ef40850b7bf79fb8e8b9ccec">category</a> (<a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a> id) noexcept</td></tr>
<tr class="memdesc:a16b26c66ef40850b7bf79fb8e8b9ccec inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a <code>category</code> with the specified <code>id</code>.  <a href="classnvtx3_1_1v1_1_1category.html#a16b26c66ef40850b7bf79fb8e8b9ccec">More...</a><br /></td></tr>
<tr class="separator:a16b26c66ef40850b7bf79fb8e8b9ccec inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d59d395dff9e74ec8bd6154581fc345 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1category.html#a5d59d395dff9e74ec8bd6154581fc345">get_id</a> () const noexcept</td></tr>
<tr class="memdesc:a5d59d395dff9e74ec8bd6154581fc345 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the id of the category.  <a href="classnvtx3_1_1v1_1_1category.html#a5d59d395dff9e74ec8bd6154581fc345">More...</a><br /></td></tr>
<tr class="separator:a5d59d395dff9e74ec8bd6154581fc345 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a11e030c15cf508cf5731b3e3d3368e inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top"><a id="a2a11e030c15cf508cf5731b3e3d3368e" name="a2a11e030c15cf508cf5731b3e3d3368e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>category</b> (<a class="el" href="classnvtx3_1_1v1_1_1category.html">category</a> const &amp;)=default</td></tr>
<tr class="separator:a2a11e030c15cf508cf5731b3e3d3368e inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac38bb4042aa84b485e5d2ee1ee436927 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top"><a id="ac38bb4042aa84b485e5d2ee1ee436927" name="ac38bb4042aa84b485e5d2ee1ee436927"></a>
<a class="el" href="classnvtx3_1_1v1_1_1category.html">category</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classnvtx3_1_1v1_1_1category.html">category</a> const &amp;)=default</td></tr>
<tr class="separator:ac38bb4042aa84b485e5d2ee1ee436927 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e69ed0a6d1b2b839ce55f2344215627 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top"><a id="a6e69ed0a6d1b2b839ce55f2344215627" name="a6e69ed0a6d1b2b839ce55f2344215627"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>category</b> (<a class="el" href="classnvtx3_1_1v1_1_1category.html">category</a> &amp;&amp;)=default</td></tr>
<tr class="separator:a6e69ed0a6d1b2b839ce55f2344215627 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9de5a026cbf16fecf46fedbaf8b34899 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top"><a id="a9de5a026cbf16fecf46fedbaf8b34899" name="a9de5a026cbf16fecf46fedbaf8b34899"></a>
<a class="el" href="classnvtx3_1_1v1_1_1category.html">category</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classnvtx3_1_1v1_1_1category.html">category</a> &amp;&amp;)=default</td></tr>
<tr class="separator:a9de5a026cbf16fecf46fedbaf8b34899 inherit pub_methods_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a3bc82f4cd71482347796787bc4436e30"><td class="memTemplParams" colspan="2">template&lt;typename C , typename std::enable_if&lt; detail::is_c_string&lt; decltype(C::name)&gt;::value &amp;&amp;detail::is_uint32&lt; decltype(C::id)&gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:a3bc82f4cd71482347796787bc4436e30"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a> const &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30">get</a> () noexcept</td></tr>
<tr class="memdesc:a3bc82f4cd71482347796787bc4436e30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a global instance of a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> as a function-local static.  <a href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30">More...</a><br /></td></tr>
<tr class="separator:a3bc82f4cd71482347796787bc4436e30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bc82f4cd71482347796787bc4436e30"><td class="memTemplParams" colspan="2">template&lt;typename C , typename std::enable_if&lt; !detail::is_c_string&lt; decltype(C::name)&gt;::value||!detail::is_uint32&lt; decltype(C::id)&gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:a3bc82f4cd71482347796787bc4436e30"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a> const &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30">get</a> () noexcept</td></tr>
<tr class="memdesc:a3bc82f4cd71482347796787bc4436e30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30" title="Returns a global instance of a named_category_in as a function-local static.">named_category_in::get</a></code> to provide a clear compile error when <code>C</code> has the required <code>name</code> and <code>id</code> members, but they are not the required types. <code>name</code> must be directly convertible to <code>char const*</code> or <code>wchar_t const*</code>, and <code>id</code> must be <code>uint32_t</code>.  <a href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30">More...</a><br /></td></tr>
<tr class="separator:a3bc82f4cd71482347796787bc4436e30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bc82f4cd71482347796787bc4436e30"><td class="memTemplParams" colspan="2">template&lt;typename C , typename std::enable_if&lt; !detail::has_name&lt; C &gt;::value||!detail::has_id&lt; C &gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:a3bc82f4cd71482347796787bc4436e30"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a> const &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30">get</a> () noexcept</td></tr>
<tr class="memdesc:a3bc82f4cd71482347796787bc4436e30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30" title="Returns a global instance of a named_category_in as a function-local static.">named_category_in::get</a></code> to provide a clear compile error when <code>C</code> does not have the required <code>name</code> and <code>id</code> members.  <a href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30">More...</a><br /></td></tr>
<tr class="separator:a3bc82f4cd71482347796787bc4436e30"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_classnvtx3_1_1v1_1_1category"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classnvtx3_1_1v1_1_1category')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classnvtx3_1_1v1_1_1category.html">nvtx3::v1::category</a></td></tr>
<tr class="memitem:a93b9c6f1e074a03ee50287c9c6414bc0 inherit pub_types_classnvtx3_1_1v1_1_1category"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a> = uint32_t</td></tr>
<tr class="memdesc:a93b9c6f1e074a03ee50287c9c6414bc0 inherit pub_types_classnvtx3_1_1v1_1_1category"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type used for <code>category</code>s integer id.  <a href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">More...</a><br /></td></tr>
<tr class="separator:a93b9c6f1e074a03ee50287c9c6414bc0 inherit pub_types_classnvtx3_1_1v1_1_1category"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename D = domain::global&gt;<br />
class nvtx3::v1::named_category_in&lt; D &gt;</div><p >A <code>category</code> with an associated name string. </p>
<p >Associates a <code>name</code> string with a category <code>id</code> to help differentiate among categories.</p>
<p >For any given category id <code>Id</code>, a <code>named_category(Id, "name")</code> should only be constructed once and reused throughout an application. This can be done by either explicitly creating static <code>named_category</code> objects, or using the <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30" title="Returns a global instance of a named_category_in as a function-local static.">named_category::get</a></code> construct on first use helper (recommended).</p>
<p >Creating two or more <code>named_category</code> objects with the same value for <code>id</code> in the same domain results in undefined behavior.</p>
<p >Similarly, behavior is undefined when a <code>named_category</code> and <code>category</code> share the same value of <code>id</code>.</p>
<p >Example: </p><div class="fragment"><div class="line"><span class="comment">// Explicitly constructed, static `named_category` in global domain:</span></div>
<div class="line"><span class="keyword">static</span> <a class="code hl_typedef" href="nvtx3_8hpp.html#a5ffa040266b85b6fb131dcb9ade33a0a">nvtx3::named_category</a> static_category{42, <span class="stringliteral">&quot;my category&quot;</span>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Range `r` associated with category id `42`</span></div>
<div class="line"><a class="code hl_typedef" href="nvtx3_8hpp.html#a8e124f3d438e512b586415f1ac2b9677">nvtx3::scoped_range</a> r{static_category};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// OR use construct on first use:</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Define a type with `name` and `id` members</span></div>
<div class="line"><span class="keyword">struct </span>my_category {</div>
<div class="line">   <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* name{<span class="stringliteral">&quot;my category&quot;</span>}; <span class="comment">// category name</span></div>
<div class="line">   <span class="keyword">static</span> <span class="keyword">constexpr</span> uint32_t <span class="keywordtype">id</span>{42}; <span class="comment">// category id</span></div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Use construct on first use to name the category id `42`</span></div>
<div class="line"><span class="comment">// with name &quot;my category&quot;</span></div>
<div class="line"><span class="keyword">auto</span>&amp; cat = named_category_in&lt;my_domain&gt;::get&lt;my_category&gt;();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Range `r` associated with category id `42`</span></div>
<div class="line"><a class="code hl_typedef" href="nvtx3_8hpp.html#a8e124f3d438e512b586415f1ac2b9677">nvtx3::scoped_range</a> r{cat};</div>
<div class="ttc" id="anvtx3_8hpp_html_a5ffa040266b85b6fb131dcb9ade33a0a"><div class="ttname"><a href="nvtx3_8hpp.html#a5ffa040266b85b6fb131dcb9ade33a0a">nvtx3::v1::named_category</a></div><div class="ttdeci">named_category_in&lt; domain::global &gt; named_category</div><div class="ttdoc">Alias for a named_category_in in the global NVTX domain.</div><div class="ttdef"><b>Definition:</b> <a href="nvtx3_8hpp_source.html#l01359">nvtx3.hpp:1359</a></div></div>
<div class="ttc" id="anvtx3_8hpp_html_a8e124f3d438e512b586415f1ac2b9677"><div class="ttname"><a href="nvtx3_8hpp.html#a8e124f3d438e512b586415f1ac2b9677">nvtx3::v1::scoped_range</a></div><div class="ttdeci">scoped_range_in&lt; domain::global &gt; scoped_range</div><div class="ttdoc">Alias for a scoped_range_in in the global NVTX domain.</div><div class="ttdef"><b>Definition:</b> <a href="nvtx3_8hpp_source.html#l02146">nvtx3.hpp:2146</a></div></div>
</div><!-- fragment --><p ><code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a>&lt;D&gt;</code>'s association of a name to a category id is local to the domain specified by the type <code>D</code>. An id may have a different name in another domain.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">D</td><td>Type containing <code>name</code> member used to identify the <code>domain</code> to which the <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> belongs. Else, <code><a class="el" href="structnvtx3_1_1v1_1_1domain_1_1global.html" title="Tag type for the &quot;global&quot; NVTX domain.">domain::global</a></code> to indicate that the global NVTX domain should be used. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01208">1208</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7fe4261f6a0b9d1cfb6e566d8ff2135f" name="a7fe4261f6a0b9d1cfb6e566d8ff2135f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fe4261f6a0b9d1cfb6e566d8ff2135f">&#9670;&#160;</a></span>named_category_in() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">nvtx3::v1::named_category_in</a>&lt; D &gt;::named_category_in </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a>&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> with the specified <code>id</code> and <code>name</code>. </p>
<p >The name <code>name</code> will be registered with <code>id</code>.</p>
<p >Every unique value of <code>id</code> should only be named once.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The category id to name </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name to associated with <code>id</code> </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01324">1324</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="a0b8ac1f00f1c0686858a20884c8eb19a" name="a0b8ac1f00f1c0686858a20884c8eb19a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b8ac1f00f1c0686858a20884c8eb19a">&#9670;&#160;</a></span>named_category_in() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">nvtx3::v1::named_category_in</a>&lt; D &gt;::named_category_in </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classnvtx3_1_1v1_1_1category.html#a93b9c6f1e074a03ee50287c9c6414bc0">id_type</a>&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wchar_t const *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> with the specified <code>id</code> and <code>name</code>. </p>
<p >The name <code>name</code> will be registered with <code>id</code>.</p>
<p >Every unique value of <code>id</code> should only be named once.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The category id to name </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name to associated with <code>id</code> </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01344">1344</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a3bc82f4cd71482347796787bc4436e30" name="a3bc82f4cd71482347796787bc4436e30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bc82f4cd71482347796787bc4436e30">&#9670;&#160;</a></span>get() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<div class="memtemplate">
template&lt;typename C , typename std::enable_if&lt; detail::is_c_string&lt; decltype(C::name)&gt;::value &amp;&amp;detail::is_uint32&lt; decltype(C::id)&gt;::value, int &gt;::type  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a> const  &amp; <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">nvtx3::v1::named_category_in</a>&lt; D &gt;::get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a global instance of a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a></code> as a function-local static. </p>
<p >Creates a <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html" title="A category with an associated name string.">named_category_in</a>&lt;D&gt;</code> with name and id specified by the contents of a type <code>C</code>. <code>C::name</code> determines the name and <code>C::id</code> determines the category id.</p>
<p >This function is useful for constructing a named <code>category</code> exactly once and reusing the same instance throughout an application.</p>
<p >Example: </p><div class="fragment"><div class="line"><span class="comment">// Define a type with `name` and `id` members</span></div>
<div class="line"><span class="keyword">struct </span>my_category {</div>
<div class="line">   <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* name{<span class="stringliteral">&quot;my category&quot;</span>}; <span class="comment">// category name</span></div>
<div class="line">   <span class="keyword">static</span> <span class="keyword">constexpr</span> uint32_t <span class="keywordtype">id</span>{42}; <span class="comment">// category id</span></div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Use construct on first use to name the category id `42`</span></div>
<div class="line"><span class="comment">// with name &quot;my category&quot;</span></div>
<div class="line"><span class="keyword">auto</span>&amp; cat = named_category_in&lt;my_domain&gt;::get&lt;my_category&gt;();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Range `r` associated with category id `42`</span></div>
<div class="line">nvtx3::scoped_range r{cat};</div>
</div><!-- fragment --><p >Uses the "construct on first use" idiom to safely ensure the <code>category</code> object is initialized exactly once. See <a href="https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use">https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use</a></p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">C</td><td>Type containing a member <code>C::name</code> that resolves to either a <code>char const*</code> or <code>wchar_t const*</code> and <code>C::id</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01250">1250</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="a3bc82f4cd71482347796787bc4436e30" name="a3bc82f4cd71482347796787bc4436e30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bc82f4cd71482347796787bc4436e30">&#9670;&#160;</a></span>get() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<div class="memtemplate">
template&lt;typename C , typename std::enable_if&lt; !detail::is_c_string&lt; decltype(C::name)&gt;::value||!detail::is_uint32&lt; decltype(C::id)&gt;::value, int &gt;::type  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a> const  &amp; <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">nvtx3::v1::named_category_in</a>&lt; D &gt;::get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30" title="Returns a global instance of a named_category_in as a function-local static.">named_category_in::get</a></code> to provide a clear compile error when <code>C</code> has the required <code>name</code> and <code>id</code> members, but they are not the required types. <code>name</code> must be directly convertible to <code>char const*</code> or <code>wchar_t const*</code>, and <code>id</code> must be <code>uint32_t</code>. </p>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01267">1267</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<a id="a3bc82f4cd71482347796787bc4436e30" name="a3bc82f4cd71482347796787bc4436e30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bc82f4cd71482347796787bc4436e30">&#9670;&#160;</a></span>get() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename D  = domain::global&gt; </div>
<div class="memtemplate">
template&lt;typename C , typename std::enable_if&lt; !detail::has_name&lt; C &gt;::value||!detail::has_id&lt; C &gt;::value, int &gt;::type  = 0&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">named_category_in</a> const  &amp; <a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html">nvtx3::v1::named_category_in</a>&lt; D &gt;::get </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Overload of <code><a class="el" href="classnvtx3_1_1v1_1_1named__category__in.html#a3bc82f4cd71482347796787bc4436e30" title="Returns a global instance of a named_category_in as a function-local static.">named_category_in::get</a></code> to provide a clear compile error when <code>C</code> does not have the required <code>name</code> and <code>id</code> members. </p>

<p class="definition">Definition at line <a class="el" href="nvtx3_8hpp_source.html#l01289">1289</a> of file <a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="nvtx3_8hpp_source.html">nvtx3.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
